package com.ifar.audiosdk.model.main.handle

import com.blankj.utilcode.util.GsonUtils
import com.ifar.audiosdk.common.IfarConfig
import com.ifar.audiosdk.common.entity.UserInfoEntity
import com.ifar.audiosdk.model.main.enum.UserStatus
import com.ifar.audiosdk.model.main.model.UserCallingState

object CallHandle {
    var otherUserInfo = UserInfoEntity()
    var updateStatusParam = UserStatus.IDLE

    /**
     * 更新用户状态
     */
    fun updateUsersStateIds(
        param: UserStatus,
        callState: String
    ): String {
        updateStatusParam = param
        var userIds = mutableListOf<UserCallingState>()
        userIds.add(UserCallingState(callState, IfarConfig.id))
        return GsonUtils.toJson(userIds)
    }


    /**
     * 重置数据
     */
    fun resetData() {
        otherUserInfo = UserInfoEntity()
        updateStatusParam = UserStatus.IDLE
    }
}